package com.pwc.conversionTool.entity;

import java.io.Serializable;

import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;


@Entity
public class SoapConnection implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -544452393876620158L;

	@Id
	private Long id;

	@Index private String connectionName;

	private String description;

	private String endpoint;

	private String passwordType;

	private String userName;

	private String password;
	
	
	@Index private Key<Account> account;
	
	
	public SoapConnection() {
		super();
	}

	public SoapConnection(String connectionName, String description, String endpoint, String passwordType, String userName, String password) {
		super();
		this.connectionName = connectionName;
		this.description = description;
		this.endpoint = endpoint;
		this.passwordType = passwordType;
		this.userName = userName;
		this.password = password;
	}



	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getConnectionName() {
		return connectionName;
	}

	public void setConnectionName(String connectionName) {
		this.connectionName = connectionName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}


	public String getPasswordType() {
		return passwordType;
	}

	public void setPasswordType(String passwordType) {
		this.passwordType = passwordType;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	@JsonIgnore
	public Key<Account> getAccount() {
		return account;
	}

	public void setAccount(Key<Account> account) {
		this.account = account;
	}

	public String getEndpoint() {
		return endpoint;
	}

	public void setEndpoint(String endpoint) {
		this.endpoint = endpoint;
	}

	@JsonIgnore
	@Transient
	public Key<SoapConnection> getKey() {
	   return Key.create(SoapConnection.class, id);
	}
	
}
